import Main from '@/views/Main.vue';

export default {
    module: {
        name: 'system',
        title: '系统管理',
    },

    router: [
        {
            path: '/system/config',
            icon: 'iot-system-settings',
            title: '系统配置',
            name: 'system-config',
            roles: ['admin', 'system'],
            component: Main,
            children: [
                {
                    path: 'index',
                    title: '系统配置',
                    name: 'system-config-index',
                    roles: ['admin', 'system'],
                    component: resolve => { require(['@/views/system/config/index.vue'], resolve); }
                }
            ]
        },
        {
            path: '/system/my',
            icon: 'iot-profiles',
            title: '个人中心',
            name: 'system-my-profiles',
            component: Main,
            children: [
                {
                    path: 'info',
                    title: '个人中心',
                    name: 'system-my-profiles-info',
                    component: resolve => { require(['@/views/system/user/profiles/user-profiles.vue'], resolve); }
                }
            ]
        },
        {
            path: '/system/user',
            icon: 'iot-user-manage',
            title: '用户管理',
            name: 'system-user',
            roles: ['admin', 'system'],
            component: Main,
            children: [
                {
                    path: 'backend/list',
                    title: '后台用户',
                    name: 'system-user-backend-index',
                    roles: ['system'],
                    component: resolve => { require(['@/views/system/user/backend/index.vue'], resolve); }
                },
                {
                    path: 'general/list',
                    title: '普通用户',
                    name: 'system-user-general-index',
                    roles: ['admin', 'system'],
                    component: resolve => { require(['@/views/system/user/general/index.vue'], resolve); }
                }
            ]
        },
        //角色权限
        {
            path: '/system/role/manage',
            icon: 'iot-permissions-manage',
            title: '角色权限',
            name: 'system-role-manage',
            roles: ['system'],
            component: Main,
            children: [
                {
                    path: 'role/list',
                    title: '角色列表',
                    name: 'system-role-list',
                    roles: ['system'],
                    component: resolve => { require(['@/views/system/role/list.vue'], resolve); }
                }
            ]
        },
        //设备管理
        {
            path: '/system/device/manage',
            icon: 'iot-device-manage',
            title: '设备管理',
            name: 'system-device-manage',
            component: Main,
            roles: ['system', 'admin', 'agent'],
            children: [
                {
                    path: 'device/list',
                    title: '设备列表',
                    name: 'system-device-list',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/device/list.vue'], resolve); }
                }
            ]
        },

        {
            path: '/system/agent/manage',
            icon: 'iot-agent-manage',
            title: '代理商',
            name: 'system-agent-manage',
            component: Main,
            roles: ['system', 'admin', 'agent'],
            agentLevels: [1,2],
            children: [
                {
                    path: 'agent/list',
                    title: '代理商列表',
                    name: 'system-agent-list',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/agent/list.vue'], resolve); }
                }
            ]
        },

        //订单列表
        {
            path: '/system/order/manage',
            icon: 'iot-orders',
            title: '订单列表',
            name: 'system-order-manage',
            roles: ['system', 'admin', 'agent'],
            component: Main,
            children: [
                {
                    path: 'order/list',
                    title: '订单列表',
                    name: 'system-order-list',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/order/list.vue'], resolve); }
                }
            ]
        },

        {
            path: '/system/report/manage',
            icon: 'iot-report',
            title: '系统报表',
            name: 'system-report-manage',
            component: Main,
            roles: ['system', 'admin', 'agent'],
            children: [
                {
                    path: 'user-report/list',
                    title: '用户余额流水记录',
                    name: 'system-user-report-list',
                    roles: ['system', 'admin'],
                    component: resolve => { require(['@/views/system/report/user_report.vue'], resolve); }
                },

                {
                    path: 'user-score-report/list',
                    title: '用户积分流水记录',
                    name: 'system-user-score-report-list',
                    roles: ['system', 'admin'],
                    component: resolve => { require(['@/views/system/report/user_score_report.vue'], resolve); }
                },

                {
                    path: 'user-balance-month-report',
                    title: '用户账户资金月报',
                    name: 'user-balance-month-report',
                    roles: ['system', 'admin'],
                    component: resolve => { require(['@/views/system/report/user_balance_month.vue'], resolve); }
                },

                {
                    path: 'agent-balance/records',
                    title: '代理余额流水记录',
                    name: 'system-agent-balance-records',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/report/agent_balance_record.vue'], resolve); }
                },

                {
                    path: 'agent-score/records',
                    title: '代理积分流水记录',
                    name: 'system-agent-score-records',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/report/agent_score_record.vue'], resolve); }
                },

                {
                    path: 'agent-report/list',
                    title: '代理商收入报表',
                    name: 'system-agent-report-list',
                    roles: ['system', 'admin', 'agent'],
                    component: resolve => { require(['@/views/system/report/agent_report.vue'], resolve); }
                }
            ]
        },

        {
            path: '/system/logs',
            icon: 'iot-logs',
            title: '系统日志',
            name: 'system-logs-manage',
            component: Main,
            roles: ['system', 'admin'],
            children: [
                {
                    path: 'operation',
                    title: '操作日志',
                    name: 'system-logs-operation-list',
                    roles: ['system', 'admin'],
                    component: resolve => { require(['@/views/system/log/operation.vue'], resolve); }
                }
            ]
        },

        {
            path: '/system/messages',
            icon: 'iot-message-manage',
            title: '消息管理',
            name: 'system-messages-manage',
            component: Main,
            roles: ['system', 'admin'],
            children: [
                {
                    path: 'sms',
                    title: '短信列表',
                    name: 'system-messages-sms-list',
                    roles: ['system', 'admin'],
                    component: resolve => { require(['@/views/system/messages/sms-list.vue'], resolve); }
                }
            ]
        },
    ],

    other_router: [
        {
            path: 'user/profiles',
            title: '个人中心',
            name: 'user-profiles',
            component: resolve => { require(['@/views/system/user/profiles/user-profiles.vue'], resolve); }
        },
        { path:
            'message/index',
            title: '消息中心',
            name: 'message-index',
            component: resolve => { require(['@/views/message/message.vue'], resolve); }
        },
        {
            path: '/system/device/add',
            title: '添加设备',
            name: 'system-device-add',
            roles: ['system', 'admin', 'agent'],
            component: resolve => { require(['@/views/system/device/add.vue'], resolve); }
        },

        {
            path: '/system/device/edit',
            title: '修改设备',
            name: 'system-device-edit',
            roles: ['system', 'admin', 'agent'],
            component: resolve => { require(['@/views/system/device/edit.vue'], resolve); }
        },
    ]
};